package com.lfs.market.controller;

import cn.dev33.satoken.annotation.SaCheckLogin;
import com.lfs.market.model.R;
import com.lfs.market.model.vo.ProductOrderStatVo;
import com.lfs.market.service.ProductInfoService;
import com.lfs.market.service.ProductOrderService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;


@RestController
@RequestMapping("/product/order")
@SaCheckLogin
public class ProductOrderController {

    @Autowired
    private ProductInfoService productInfoService;

    @Autowired
    private ProductOrderService productOrderService;

    @GetMapping("/stat")
    public R<ProductOrderStatVo> getProductOrderList() {
        ProductOrderStatVo userStat = productInfoService.getProductOrderList();
        return  R.ok(userStat);
    }

//    /**
//     * 买到的商品
//     * @return
//     */
//    @GetMapping("/my/buy")
//    public R<List<ProductInfo>> getMyProductInfo() {
//        List<ProductInfo> list = productOrderService.getBuyProductInfo();
//        return R.ok(list);
//
//    }

}
